<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>条件渲染</title>
</head>
<body>

<div id="app">


</div>


</body>
<script src="../lib/react/react.development.js"></script>
<script src="../lib/react/react-dom.development.j.js"></script>
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
<script type="text/babel">


    function UserGreeting(props) {
         return <h1>欢迎回来！</h1>
    }

    function GuestGreeting(props) {

        return <h1>请先注册！</h1>
    }

    function App(props) {

        const isLoggedIn = props.isLoggedIn;

        if(isLoggedIn){
            return <UserGreeting/>
        }

        return  <GuestGreeting/>
    }


    ReactDOM.render(
        <App isLoggedIn={false}/>,
        document.getElementById('app')
    )


</script>
</html>